package com.tiancheng.trade.payment.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tiancheng.trade.payment.enums.ChannelRefundTypeEnum;
import com.tiancheng.trade.payment.enums.FlowStatusEnum;
import com.tiancheng.trade.payment.model.IntRefundFlowDetail;
import com.tiancheng.trade.payment.vo.admin.res.PaymentRefundFlowDetailResVo;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;

/**
 英文版支付退款明细
 */
public interface IntRefundFlowDetailService {
    /**
     * 批量插入
     *
     * @param details {@link List <PaymentRefundFlowDetail>}
     * @return {@link Integer}
     */
    Integer saveBatch(List<IntRefundFlowDetail> details);


    /**
     * 查询退款流水明细，根据退款流水号
     *
     * @param flowId
     * @return
     */
    List<IntRefundFlowDetail> findByFlowId(String flowId);

    /**
     * 修改子订单退款状态
     * @param flowId
     * @param subOrderId
     * @param refundType
     * @param flowStatusEnum
     * @return
     */
    Integer updateRefundStatus(String flowId, String subOrderId, ChannelRefundTypeEnum refundType,
                               FlowStatusEnum flowStatusEnum);

    /**
     * 批量查询
     *
     * @param condition
     * @return
     */
    List<IntRefundFlowDetail> selectList(QueryWrapper<IntRefundFlowDetail> condition);


    List<PaymentRefundFlowDetailResVo> findSettleByFlowId(String flowId);

    /**
     * 退款流水明细批量更新-所更新字段值相同
     *
     * @param ids       id
     * @param colValMap 字段-值：(column, value)
     * @return
     */
    Integer updateSettleBatch(Collection<Long> ids, HashMap<String, Object> colValMap);



    /**
     * 查询退款流水明细，根据退款流水号
     *
     * @param subFlowId
     * @return
     */
    IntRefundFlowDetail findBySubFlowId(String subFlowId);

}
